/**
 * @author xuyh0817
 * @email xuyh0817@foxmail.com
 * @date 2022-02-16 15:41
 * @version 2.0.0
 * @doc todo
 * @website todo
 * @remark  如果要分发源码，需在本文件顶部保留此文件头信息！！
 */

/**
 * 组件的公共方法
 */
import ExtendSlot from '../components/XRenderExtendSlot/XRenderExtendSlot'

export default {
  inheritAttrs: false,
  name: 'XRenderComponentMixin',
  inject: ['xRenderForm'],
  components: {
    ExtendSlot
  },
  props: {
    // 组件的唯一id
    id: {
      type: String,
      default: ''
    },
    // 组件的属性值
    attrs: {
      type: Object,
      default: () => {
        return {}
      }
    },
    // 组件的表单属性值
    formItem: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  methods: {
    getSlotData() {
      const { value, attrs, formItem } = this
      return {
        value,
        attrs,
        formItem
      }
    }
  }
}
